<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head th:replace="common/index :: head"></head>
	<body class="mainbody">
		<div th:replace="common/index :: location('我的相册')"></div>
		<div th:fragment="toolbar" class="toolbar-wrap">
			<div class="toolbar">
				<div class="box-wrap">
					<a class="menu-btn"></a>
					<div class="l-list">
						<ul class="icon-list">
							<li><a class="add" href="albumsAdd"><i></i><span>新增</span></a></li>
						</ul>
					</div>
					<div class="r-list">
		                <input type="button" class="btn" onclick="$('#searchForm').toggle()" value="检索选项"/>
		            </div>
				</div>
			</div>
		</div>
		<form id="searchForm" method="GET" style="display:none;" th:object="${search}">
			<input type="hidden" name="page" th:value="${page.number+1}" />
			<input type="hidden" name="size" th:value="${page.size}" />
			<div class="det-list clearfix">
			    <div class="group btm">
					<div class="control">
			            <div class="title">图片名称</div>
			            <input name="name" class="input normal" type="text" th:value="*{name}"/>
			        </div>
			    </div>
			    <div class="group searchbtn">
			        <div class="btn-list">
			            <input type="submit" value="查询" class="btn" />
			            <input type="reset" value="重置" class="btn yellow" />
			        </div>
			    </div>
			    <div style="clear:both;"></div>
			</div>
		</form>
		
		<table id="list">
			<thead>
				<tr><th>图片名称</th><th>图片大小</th><th>创建日期</th><th width="250">操作</th></tr>
			</thead>
			<tbody>
				<tr th:each="obj : ${page.content}" th:object="${obj}">
					<td th:text="*{name}"></td>
					<td th:text="*{size}"></td>
					<td th:text="*{createDate}"></td>
					<td>
						<a th:href="'javascript:deleteObj('+*{id}+')'">删除</a>
					</td>
				</tr>
			</tbody>
		</table>
		
		<div th:replace="common/index :: pagination(${page})"></div>
		<script type="text/javascript" th:replace="common/index :: indexscript"></script>
		<script>
		function deleteObj(id){
			if(confirm("确认删除?")) location.href="album/"+id+"/delete";
		}
		</script>
	</body>
</html>